#ifndef __ARRAY_H__
#define __ARRAY_H__

#include <cstddef>
#include <iostream>

class array {
	private:
		int * memory;      //int values buffer
		size_t capacity;   //capacity of array
		size_t size;       //current length

		void riseup();
	public:
		/* riseup coefficient  */
		static const unsigned int rise_val = 2;

		array(size_t size);
		array(const array& obj);
		~array();
		void swap(array & obj);
		array & operator=(array obj);
		int & operator[](size_t pos);
		const int & operator[](size_t pos) const;

		void push_back(int value);
		void set(size_t pos, int value);
		int get(size_t pos) const;
		size_t get_size() const;

		void print(std::ostream & out) const;
};

std::ostream & operator<<(std::ostream & out, const array & obj);

#endif /*__ARRAY_H__*/
